﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DemoApp1
{
    /// <summary>
    /// 绘图 样例
    /// </summary>
    public class DrawShapeDemo
    {
        /// <summary>
        /// 长方形
        /// </summary>
        public void ShowRectangle()
        {
            var w = 20;
            var h = 4;
            Console.WriteLine();
            Console.WriteLine("长方形");

            for (var j = 0; j < h; j++)
            {
                for (var i = 0; i < w; i++)
                {
                    Console.Write("#");
                }
                Console.WriteLine();
            }
        }

        /// <summary>
        /// 等腰梯形
        /// </summary>
        public void ShowTixing()
        {
            Console.WriteLine();
            Console.WriteLine("梯形");
           
            var w = 40;
            var h = 6;
            var space = 0;
            var line = w;
            for (var i = 0; i < h; i++)
            {
                for (var j = 0; j < space; j++)
                {
                    Console.Write(" ");
                }
                for (var j = 0; j < line; j++)
                {
                    Console.Write("V");
                }
                space++;
                line -= 2;
                Console.WriteLine();
            }
        }

    }
}
